<?xml version="1.0"?>
<Workbook xmlns="urn:schemas-microsoft-com:office:spreadsheet"
          xmlns:o="urn:schemas-microsoft-com:office:office"
          xmlns:x="urn:schemas-microsoft-com:office:excel"
          xmlns:ss="urn:schemas-microsoft-com:office:spreadsheet"
          xmlns:html="http://www.w3.org/TR/REC-html40">
  <ss:Styles>
    <ss:Style ss:ID="Custom">
      <ss:Alignment ss:Horizontal="Center" ss:Vertical="Center" />
      <ss:Font ss:Color="Red" ss:Size="16"/>
    </ss:Style>
    <ss:Style ss:ID="RightAlign">
      <ss:Alignment ss:Horizontal="Right"/>
    </ss:Style>
    <ss:Style ss:ID="CenterAlign">
      <ss:Alignment ss:Horizontal="Center"/>
    </ss:Style>
    <ss:Style ss:ID="Bold">
      <ss:Font ss:Bold="1"/>
    </ss:Style>
  </ss:Styles>
  <Worksheet ss:Name="TK_NhanVien">
    <Table>
      <Column ss:Width="20"></Column>
      <Column ss:Width="250"></Column>
      <Column ss:Width="80"></Column>
      <Column ss:Width="80"></Column>
      <Row></Row>
      <Row ss:Height="50">
        <Cell></Cell>
        <Cell ss:StyleID="Custom" ss:MergeAcross="3"><Data ss:Type="String">Chi tiết nhân viên <%= NhanVien.find(params[:nhanvienID]).TenNV %></Data></Cell>
      </Row>
      <Row></Row>
      <Row>
        <Cell></Cell>
        <Cell ss:StyleID="Bold"><Data ss:Type="String">Số lượng phòng đang quản lí</Data></Cell>
        <Cell><Data ss:Type="Number"><%= @quanli.count %></Data> </Cell>
      </Row>
      <% if @quanli.empty? != true then %>
      <Row>
        <Cell></Cell>
        <Cell ss:MergeAcross="1"><Data ss:Type="String">Chi tiết</Data></Cell>
      </Row>
      <Row>
        <Cell></Cell>
        <Cell><Data ss:Type="String">Tên phòng</Data></Cell>
        <Cell><Data ss:Type="String">Ngày bắt đầu</Data></Cell>
      </Row>
      <% @quanli.each_with_index do |ql, i| %>
          <Row>
            <Cell></Cell>
            <Cell><Data ss:Type="String"><%= ql.phong.TenPhongg %></Data></Cell>
            <Cell><Data ss:Type="String"><%= l ql.ngay_cap_nhat, :format => :custom %></Data></Cell>
          </Row>
      <% end %>
      <% end %>
      <Row></Row>
      <Row>
        <Cell></Cell>
        <Cell ss:StyleID="Bold"><Data ss:Type="String">Số tài sản đang sở hữu</Data></Cell>
        <Cell><Data ss:Type="Number"><%= @sohuu.count %></Data> </Cell>
      </Row>
      <% if @sohuu.empty? != true then %>
          <Row>
            <Cell></Cell>
            <Cell ss:MergeAcross="1"><Data ss:Type="String">Chi tiết</Data></Cell>
          </Row>
          <Row>
            <Cell></Cell>
            <Cell><Data ss:Type="String">Tên tài sản</Data></Cell>
            <Cell><Data ss:Type="String">Ngày cấp</Data></Cell>
          </Row>
          <% @sohuu.each_with_index do |sh, i| %>
              <Row>
                <Cell></Cell>
                <Cell><Data ss:Type="String"><%= sh.tai_san.TenTS %></Data></Cell>
                <Cell><Data ss:Type="String"><%= l sh.ngay_cap_nhat, :format => :custom %></Data></Cell>
              </Row>
          <% end %>
      <% end %>
      <Row></Row>
      <Row>
        <Cell></Cell>
        <Cell ss:StyleID="Bold"><Data ss:Type="String">Số tài sản nhập đã xử lí</Data></Cell>
        <Cell><Data ss:Type="Number"><%= @pnhap.count %></Data> </Cell>
      </Row>
      <% if @pnhap.empty? != true then %>
          <Row>
            <Cell></Cell>
            <Cell ss:MergeAcross="1"><Data ss:Type="String">Chi tiết</Data></Cell>
          </Row>
          <Row>
            <Cell></Cell>
            <Cell><Data ss:Type="String">Tên tài sản</Data></Cell>
            <Cell><Data ss:Type="String">Số lượng</Data></Cell>
            <Cell><Data ss:Type="String">Trạng thái</Data></Cell>
          </Row>
          <% @pnhap.each_with_index do |pn, i| %>
              <Row>
                <Cell></Cell>
                <Cell><Data ss:Type="String"><%= pn.tai_san.TenTS %></Data></Cell>
                <Cell><Data ss:Type="String"><%= pn.so_luong %></Data></Cell>
                <% if pn.trang_thai == 1 then  %>
                    <Cell><Data ss:Type="String">Đã nhận</Data></Cell>
                <% elsif pn.trang_thai == -1 then %> <Cell><Data ss:Type="String">Huỷ</Data></Cell>
                <% else %> <Cell><Data ss:Type="String">Chưa nhận</Data></Cell>
                <% end %>
              </Row>
          <% end %>
      <% end %>
    </Table>
  </Worksheet>
</Workbook>